package demo1;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Test1 {
    public static void main(String[] args) {
        try {
            Class<?> c1 =  Class.forName("demo1.TestEnum");
            Constructor con = c1.getDeclaredConstructor( String.class , int.class, String.class , int.class);
            con.setAccessible(true);
              con.newInstance("father", 99,"TXT", 8);
            System.out.println();
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
